package com.woniuxy.oa.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration 
public class MyWebMvcConfig implements WebMvcConfigurer {

//	@Override
//	public void addInterceptors(InterceptorRegistry registry) {
//		//配置拦截路径，excludePathPatterns表示放行
//		registry.addInterceptor(new LoginHandlerInterceptor())
//		.addPathPatterns("/**")
//		.excludePathPatterns("/","/user/login", "/css/**","/bootstrap/**","/img/**","/js/**");
//	}

	// 自定义路径的视图解析
	@Override 
	public void addViewControllers(ViewControllerRegistry registry) {
		// 相当于web.xml中的访问路径映射，访问/相当于访问login,login又会被默认的解析器加上前缀和后缀，相当于去找templates下的login.html
		registry.addViewController("/").setViewName("system/index/index"); 
//		registry.addViewController("/top.html").setViewName("system/index/top");
//		registry.addViewController("/index.html").setViewName("system/index/index");
//		registry.addViewController("/menu.html").setViewName("system/index/menu");
//		registry.addViewController("/content.html").setViewName("system/index/content");
//		registry.addViewController("/password.html").setViewName("system/index/password");
//		registry.addViewController("/login.html").setViewName("login");
//		registry.addViewController("/addressList.html").setViewName("system/addressList");
//		registry.addViewController("/addUser.html").setViewName("system/addUser");
//		registry.addViewController("/apply.html").setViewName("system/apply");
//		registry.addViewController("/attendance.html").setViewName("system/attendance");
//		registry.addViewController("/attendanceSetting.html").setViewName("system/attendanceSetting");
//		registry.addViewController("/examine.html").setViewName("system/examine");
//		registry.addViewController("/jurisdiction.html").setViewName("system/jurisdiction");
//		registry.addViewController("/leave.html").setViewName("system/leave");
//		registry.addViewController("/noticeAdd.html").setViewName("system/noticeAdd");
//		registry.addViewController("/noticeDetail.html").setViewName("system/noticeDetail");
//		registry.addViewController("/noticeExamin.html").setViewName("system/noticeExamin");
//		registry.addViewController("/noticeMy.html").setViewName("system/noticeMy");
//		registry.addViewController("/officeApply.html").setViewName("system/officeApply");
//		registry.addViewController("/officeSubscribe.html").setViewName("system/officeSubscribe");
//		registry.addViewController("/overtime.html").setViewName("system/overtime");
//		registry.addViewController("/schedule.html").setViewName("system/schedule");
//		registry.addViewController("/userInfo.html").setViewName("system/userInfo");
//		registry.addViewController("/updateAttendanceSetting.html").setViewName("system/updateAttendanceSetting");
//		registry.addViewController("/userList.html").setViewName("system/userList");
//		registry.addViewController("/work.html").setViewName("system/work");
//		registry.addViewController("/").setViewName("login");
		 
		 
	}
	
}

